<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <button id="btn">btn</button>
    <script>
        var btn = document.getElementById("btn");
        btn.onclick = function(){
            // window.open("https://www.baidu.com");
            //点击之后在新开的页面跳转
            //open可以传递几个参数
            window.open("https://www.baidu.com","baidu","width=200,height=200,left=30,top=140");
            window.close();
            //关掉自己这个页面
        }
    </script>
</body>
</html>